<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>管理员列表</title>

    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="__PUBLIC__/dist/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="__PUBLIC__/dist/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/plugins/iCheck/custom.css" rel="stylesheet">

    <link href="__PUBLIC__/dist/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{$info ? '编辑' : '新增'}管理员</h5>
                </div>
                <div class="ibox-content">
                    <form id="myform" role="form" class="form-horizontal m-t" method="post">
                        <div class="form-group draggable ui-draggable">
                            <label class="col-sm-2 control-label">账号：</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="username" name="username" value="{$info.username}" placeholder="请输入账号" required>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group draggable ui-draggable">
                            <label class="col-sm-2 control-label">密码：</label>
                            <div class="col-sm-10">
                                <input type="password"  class="form-control" id="password" name="password" value="" placeholder="请输入密码">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group draggable ui-draggable">
                            <label class="col-sm-2 control-label">确认密码：</label>
                            <div class="col-sm-10">
                                <input type="password" class="form-control" id="repass" name="repass" placeholder="请输入确认密码">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        {if condition="$businesses_id eq 0"}
                        <div class="form-group draggable ui-draggable">
                            <label class="col-sm-2 control-label">所属商家：</label>
                            <div class="col-sm-6">
                                <select id="businesses_id" name="businesses_id" class="form-control" required>
                                    {foreach name="businesses" item="item"}
                                    {if condition="$item['id'] eq $info['businesses_id']"}
                                    <option value="{$item.id}" selected="selected">
                                        {$item.name}
                                    </option>
                                    {else/}
                                    <option value="{$item.id}">
                                        {$item.name}
                                    </option>
                                    {/if}
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        {else/}
                        <input type="hidden" name="businesses_id" value="{$businesses_id}">
                        {/if}
                        <div class="form-group draggable ui-draggable">
                            <label class="col-sm-2 control-label">角色：</label>
                            <div class="col-sm-10">
                                <select id="role_id" name="role_id" class="form-control" required>
                                    <option value="">请选择角色</option>
                                    {foreach name="roles" item="item"}
                                        <option value="{$item.id}" {if condition="$item['id'] eq $info['role_id']"}selected{/if} >{$item.name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group draggable ui-draggable">
                            <label class="col-sm-2 control-label">选择门店：</label>
                            <div class="col-sm-10">
                                {foreach name="stores" item="item"}
                                <div class="checkbox checkbox-success checkbox-inline">
                                    <input type="checkbox" class="power_parent_id_52" value="{$item.id}" id="store_id_{$item.id}" name="store_ids[]" {if condition="in_array($item['id'],$adminStoreArr)"}checked{/if}>
                                    <label for="store_id_{$item.id}">
                                        {$item.name}
                                    </label>
                                </div>
                                {/foreach}
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group draggable ui-draggable">
                            <div class="col-sm-12 col-sm-offset-3">
                                <input type="hidden" name="IP" value="{$info.IP}">
                                <input type="hidden" name="lasttime" value="{$info.lasttime}">
                                <input type="hidden" name="id" value="{$info.id}">
                                <button class="btn btn-primary" type="submit">确定</button>
                                <button class="btn btn-white" type="submit" onclick="javascript:history.go(-1);">取消</button>
                            </div>
                        </div>
                    </form>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__PUBLIC__/dist/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/dist/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/dist/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="__PUBLIC__/dist/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="__PUBLIC__/dist/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="__PUBLIC__/dist/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/dist/js/plugins/iCheck/icheck.min.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/libs/global.js?rnd=12345678"> </script>

	<script>
		$().ready(function() {
		// 在键盘按下并释放及提交后验证提交表单
		  $("#myform").validate({
			rules: {
			  username: {
				required: true,
				rangelength: [6,32]
			  },
			  password: {
				rangelength: [6,32]
			  },
			  repass: {
				rangelength: [6,32],
				equalTo: "#password"
			  },
			  role_id: {
				required: "#newsletter:selected"
			  }
			},
			messages: {
			  username: {
				required: "请输入账号",
				rangelength: "账号长度不能小于 6 个字母"
			  },
			  password: {
				rangelength: "密码长度不能小于 6 个字母"
			  },
			  repass: {
				rangelength: "密码长度不能小于 6 个字母",
				equalTo: "两次密码输入不一致"
			  },
			  role_id: "请选择角色权限"
			 },submitHandler: function(form) {
				  form.submit();
			}
			})
		});
	</script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->
</html>
